class City < ActiveRecord::Base
  
  #attr GMAPS opzionale
  attr_accessible :gmaps, :latitude, :longitude, :name, :population, :state, :string
  
     
  #validates_uniqueness_of :state 
  #validates_presence_of :lat, :lng
  
  # OPTIONS:
  #
  # - the geocode will be performed each time the model is run through a validate method
  #
  #:process_geocoding => true : 							
  #
  # - if the position of the address provided isn't found by google, an error will be displayed
  #
  #:validation => true : 							
  #
  # - latitude and longitude will be saved in the columns latitude and longitude
  #
  #:lat => "latitude", :lng => "longitude" : 
  #
  # - the status of the geocode, will be checked in a method or in db column boolean called gmaps. 
  #	  Note: If :check_process is set to false then lat & long will be updated when the model is updated.
  #
  #:check_process => true, :checker => "gmaps" : 
  #
  # - will look for the default gmaps4rails_address
  #
  #:address =>"gmaps4rails_address": 
  acts_as_gmappable 
  
  # Describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki
  # Example: 
  # "#{self.street}, #{self.city}, #{self.country}" 
  def gmaps4rails_address
	"#{name}, #{state}"
  end
  
end
